package com.ruoyi.system.api.factory;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.RemoteAccountService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @description:账套服务降级处理
 * @author: Yuan
 * @create: 2025-02-27 15:05
 **/
@Component
public class RemoteAccountFallbackFactory implements FallbackFactory<RemoteAccountService> {

    private static final Logger log = LoggerFactory.getLogger(RemoteAccountFallbackFactory.class);
    @Override
    public RemoteAccountService create(Throwable cause) {
        log.error("账套服务调用失败:{}",cause.getMessage());
        return new RemoteAccountService() {
            @Override
            public Long getAccountId() {
                return null;
            }
        };
    }
}
